/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "ALIQUOTAS")
public class Aliquotas implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    @GeneratedValue(generator = "GEN_ALIQUOTAS",strategy = GenerationType.SEQUENCE)
    @SequenceGenerator(name = "GEN_ALIQUOTAS",allocationSize = 1,sequenceName = "SQ_ALIQUOTAS")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "DESCRICAO")
    private int descricao;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @Column(name = "IPI")
    private BigDecimal ipi;
    @Basic(optional = false)
    @Column(name = "ICMS")
    private BigDecimal icms;
    @Basic(optional = false)
    @Column(name = "ISS")
    private BigDecimal iss;

    public Aliquotas() {
    }

    public Aliquotas(Integer id) {
        this.id = id;
    }

    public Aliquotas(Integer id, int descricao, BigDecimal ipi, BigDecimal icms, BigDecimal iss) {
        this.id = id;
        this.descricao = descricao;
        this.ipi = ipi;
        this.icms = icms;
        this.iss = iss;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        Integer oldId = this.id;
        this.id = id;
        changeSupport.firePropertyChange("id", oldId, id);
    }

    public int getDescricao() {
        return descricao;
    }

    public void setDescricao(int descricao) {
        int oldDescricao = this.descricao;
        this.descricao = descricao;
        changeSupport.firePropertyChange("descricao", oldDescricao, descricao);
    }

    public BigDecimal getIpi() {
        return ipi;
    }

    public void setIpi(BigDecimal ipi) {
        BigDecimal oldIpi = this.ipi;
        this.ipi = ipi;
        changeSupport.firePropertyChange("ipi", oldIpi, ipi);
    }

    public BigDecimal getIcms() {
        return icms;
    }

    public void setIcms(BigDecimal icms) {
        BigDecimal oldIcms = this.icms;
        this.icms = icms;
        changeSupport.firePropertyChange("icms", oldIcms, icms);
    }

    public BigDecimal getIss() {
        return iss;
    }

    public void setIss(BigDecimal iss) {
        BigDecimal oldIss = this.iss;
        this.iss = iss;
        changeSupport.firePropertyChange("iss", oldIss, iss);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Aliquotas)) {
            return false;
        }
        Aliquotas other = (Aliquotas) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.beans.Aliquotas[ id=" + id + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
